From 0c25c5d43d3a299698a54b31107339861e556a2d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Fri, 19 Feb 2016 13:22:02 +0100 Subject: [PATCH] revealer: Don't report >0 preferred width... ... if the child is concealed and the transition type is set to NONE. In this case, both preferred width and preferred height should be 0, but we still can't use that to allocate a size for the child, so care about the minimum size of the child in gtk_revealer_get_child_allocation. https://bugzilla.gnome.org/show_bug.cgi?id=761760 --- gtk/gtkrevealer.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c index e4d144b56d..52ebd26b87 100644 --- a/gtk/gtkrevealer.c +++ b/gtk/gtkrevealer.c @@ -339,6 +339,13 @@ gtk_revealer_get_child_allocation (GtkRevealer *revealer, transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT) gtk_widget_get_preferred_width_for_height (child, MAX (0, allocation->height - vertical_padding), NULL, &child_allocation->width); + else if (transition == GTK_REVEALER_TRANSITION_TYPE_NONE) + { + gtk_widget_get_preferred_width_for_height (child, MAX (0, allocation->height - vertical_padding), NULL, + &child_allocation->width); + gtk_widget_get_preferred_height_for_width (child, MAX (0, allocation->width - horizontal_padding), NULL, + &child_allocation->height); + } else gtk_widget_get_preferred_height_for_width (child, MAX (0, allocation->width - horizontal_padding), NULL, &child_allocation->height); @@ -873,7 +880,8 @@ set_width_with_paddings (GtkRevealer *revealer, natural_width = preferred_natural_width + horizontal_padding; transition = effective_transition (revealer); - if (transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT || + if (transition == GTK_REVEALER_TRANSITION_TYPE_NONE || + transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT || transition == GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT) { /* Paddings are included in the animation */ -- 2.30.2